﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category6
{
  public class MT649 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagSubItemDefinition U0008;
    private static SwiftTagDefinition U000E;
    private static SwiftTagDefinition U000F;
    private static SwiftTagDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagChoiceDefinition U0012;
    private static SwiftTagDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagDefinition U001A;

    [Description("Transaction Reference Number")]
    public Tag20 TransactionReferenceNumber_20
    {
      get
      {
        return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0002);
      }
    }

    [Description("Transaction Reference Number")]
    public Tag20 Tag20_TransactionReferenceNumber
    {
      get
      {
        return this.TransactionReferenceNumber_20;
      }
    }

    [Description("Related Reference")]
    public Tag21 RelatedReference_21
    {
      get
      {
        return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0004);
      }
    }

    [Description("Related Reference")]
    public Tag21 Tag21_RelatedReference
    {
      get
      {
        return this.RelatedReference_21;
      }
    }

    [Description("Sequence Of Total")]
    public Tag27 SequenceOfTotal_27
    {
      get
      {
        return new Tag27((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0006);
      }
    }

    [Description("Sequence Of Total")]
    public Tag27 Tag27_SequenceOfTotal
    {
      get
      {
        return this.SequenceOfTotal_27;
      }
    }

    [Description("From")]
    public Tag29A From_29A
    {
      get
      {
        return new Tag29A((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U000E);
      }
    }

    [Description("From")]
    public Tag29A Tag29A_From
    {
      get
      {
        return this.From_29A;
      }
    }

    [Description("To The Attention Of")]
    public Tag29B ToTheAttentionOf_29B
    {
      get
      {
        return new Tag29B((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U000F);
      }
    }

    [Description("To The Attention Of")]
    public Tag29B Tag29B_ToTheAttentionOf
    {
      get
      {
        return this.ToTheAttentionOf_29B;
      }
    }

    [Description("Borrower's")]
    public MT649.Tag88D Borrowers_88D
    {
      get
      {
        return new MT649.Tag88D((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0010);
      }
    }

    [Description("Borrower's")]
    public MT649.Tag88D Tag88D_Borrowers
    {
      get
      {
        return this.Borrowers_88D;
      }
    }

    [Description("Facility Amount")]
    public Tag32A FacilityAmount_32A
    {
      get
      {
        return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0013);
      }
    }

    [Description("Facility Amount")]
    public Tag32A Tag32A_FacilityAmount
    {
      get
      {
        return this.FacilityAmount_32A;
      }
    }

    [Description("Facility Amount")]
    public Tag32B FacilityAmount_32B
    {
      get
      {
        return new Tag32B((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U0017);
      }
    }

    [Description("Facility Amount")]
    public Tag32B Tag32B_FacilityAmount
    {
      get
      {
        return this.FacilityAmount_32B;
      }
    }

    [Description("Narrative")]
    public Tag79 Narrative_79
    {
      get
      {
        return new Tag79((SwiftElement) this, 0, (SwiftDefinitionElement) MT649.U001A);
      }
    }

    [Description("Narrative")]
    public Tag79 Tag79_Narrative
    {
      get
      {
        return this.Narrative_79;
      }
    }

    public MT649()
      : base(true)
    {
    }

    public MT649(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT649.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT649.MessageDefinition = new SwiftMessageDefinition("MT649", "General Syndicated Facility Message");
      MT649.U0002 = new SwiftTagDefinition("TransactionReferenceNumber_20", "Transaction Reference Number");
      MT649.U0002.TagName = ":20:";
      MT649.U0003 = new SwiftTagSubItemDefinition("Reference", "Transaction Reference Number");
      MT649.U0002.Elements.Add((SwiftDefinitionElement) MT649.U0003);
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U0002);
      MT649.U0004 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT649.U0004.TagName = ":21:";
      MT649.U0004.Mandatory = false;
      MT649.U0005 = new SwiftTagSubItemDefinition("Reference", "Related Reference");
      MT649.U0004.Elements.Add((SwiftDefinitionElement) MT649.U0005);
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U0004);
      MT649.U0006 = new SwiftTagDefinition("SequenceOfTotal_27", "Sequence Of Total");
      MT649.U0006.TagName = ":27:";
      MT649.U0006.Mandatory = false;
      MT649.U0007 = new SwiftTagSubItemDefinition("Number", "Number");
      MT649.U0006.Elements.Add((SwiftDefinitionElement) MT649.U0007);
      MT649.U0008 = new SwiftTagSubItemDefinition("Total", "Total");
      MT649.U0006.Elements.Add((SwiftDefinitionElement) MT649.U0008);
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U0006);
      MT649.U000E = new SwiftTagDefinition("From_29A", "From");
      MT649.U000E.TagName = ":29A:";
      MT649.U000E.Mandatory = false;
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U000E);
      MT649.U000F = new SwiftTagDefinition("ToTheAttentionOf_29B", "To The Attention Of");
      MT649.U000F.TagName = ":29B:";
      MT649.U000F.Mandatory = false;
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U000F);
      MT649.U0010 = new SwiftTagDefinition("Borrowers_88D", "Borrower's");
      MT649.U0010.TagName = ":88D:";
      MT649.U0011 = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT649.U0010.Elements.Add((SwiftDefinitionElement) MT649.U0011);
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U0010);
      MT649.U0012 = new SwiftTagChoiceDefinition("Choice", "");
      MT649.U0012.Mandatory = false;
      MT649.U0012.Multiple = true;
      MT649.U0013 = new SwiftTagDefinition("FacilityAmount_32A", "Facility Amount");
      MT649.U0013.TagName = ":32A:";
      MT649.U0014 = new SwiftTagSubItemDefinition("Date", "Date");
      MT649.U0013.Elements.Add((SwiftDefinitionElement) MT649.U0014);
      MT649.U0015 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT649.U0013.Elements.Add((SwiftDefinitionElement) MT649.U0015);
      MT649.U0016 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT649.U0013.Elements.Add((SwiftDefinitionElement) MT649.U0016);
      MT649.U0012.Elements.Add((SwiftDefinitionElement) MT649.U0013);
      MT649.U0017 = new SwiftTagDefinition("FacilityAmount_32B", "Facility Amount");
      MT649.U0017.TagName = ":32B:";
      MT649.U0018 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT649.U0017.Elements.Add((SwiftDefinitionElement) MT649.U0018);
      MT649.U0019 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT649.U0017.Elements.Add((SwiftDefinitionElement) MT649.U0019);
      MT649.U0012.Elements.Add((SwiftDefinitionElement) MT649.U0017);
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U0012);
      MT649.U001A = new SwiftTagDefinition("Narrative_79", "Narrative");
      MT649.U001A.TagName = ":79:";
      MT649.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT649.U001A);
    }

    public class Tag88D : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("88D", value);
        }
      }

      internal Tag88D(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }
  }
}
